<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="index.xhtml">
	<ui:define name="body">

		<script type="text/javascript">
			$(document).ready(function() {
				$(".submenu-active").removeClass('submenu-active');
				$("#role").addClass('submenu-active');
			});
		</script>

		<html>

<f:view>




	<!-- Start  Edit Operation  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:dialog id="editOperationId" header="Editer une Operation"
		widgetVar="editOperationWv" style="font-size: 0.9em" height="550"
		modal="false" resizable="true" width="550">


		<ui:include src="editOperation.xhtml" />



	</p:dialog>

	<!-- End  Edit Operation  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- ________________________ -->












	<!-- Start  Edit Tache  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:dialog id="editTacheId" header="Editer une tache"
		widgetVar="editTacheWv" style="font-size: 0.9em" height="550"
		modal="true" resizable="true" width="550">


		<ui:include src="editTask.xhtml" />



	</p:dialog>

	<!-- End  Edit Tache  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- ________________________ -->






	<!-- Start  Add Operation2  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:dialog id="addOperation2" header="Ajouter une Operation"
		widgetVar="addOperation2Wv" style="font-size: 0.9em, center top"
		height="550" modal="true" resizable="true" width="750">


		<ui:include src="addOperation.xhtml" />


	</p:dialog>

	<!-- End  Add Operation2  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- ________________________ -->




	<!-- Start  Add Tache  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:dialog id="addTache" header="Ajouter une tache"
		widgetVar="addTacheWv" style="font-size: 0.9em, center top"
		height="550" modal="true" resizable="true" width="750">

		<ui:include src="addTask.xhtml" />


	</p:dialog>

	<!-- End  Add Tache  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- ________________________ -->






	<!-- Start  Add Processus  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:dialog id="addProcessus" header="Ajouter un processus" modal="true"
		resizable="true" style="font-size: 0.9em" widgetVar="addProcessusWv"
		height="550" width="550">
		<h:form id="addProcessusFormId">
			<table class="nostyle">
				<tr>
					<td>
						<h5>Nom du processus :</h5>
					</td>
					<td><p:inputText /></td>
				</tr>
				<tr>
					<td><h5>Numero du processus :</h5></td>
					<td><p:inputText /></td>
				</tr>
				<tr>
					<td><h5>Commentaire :</h5></td>
				</tr>
			</table>
			<p:inputTextarea rows="5" cols="45" maxlength="10"
				counterTemplate="{0} characters remaining." autoResize="false" />
			<center>
				<table class="nostyle">
					<tr>
						<td><p:commandButton id="btn-create-proc" value="Enregistrer"></p:commandButton></td>
						<td><p:commandButton id="btn-del" value="Annuler"></p:commandButton></td>
					</tr>
				</table>
			</center>
		</h:form>
	</p:dialog>

	<!-- End  Add Processus  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- Start  Supprimer Operation  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:confirmDialog id="deleteOperationDialog"
		message="Vous êtes sur de vouloir supprimer cette operation ?"
		header="Supprimer une operation" severity="alert"
		widgetVar="deleteOperationDialogWv">
		<h:form>
			<p:outputPanel id="delOperationPanel">
				<div align="right">
					<p:commandButton id="deleteOpeCancelId" value="Annuler"
						oncomplete="deleteOperationDialogWv.hide()" />
					<p:commandButton id="confirmdeleteOpeId" value="Supprimer"
						oncomplete="deleteOperationDialogWvl.hide()"
						actionListener="#{activiteManagedBean.deleteOperation}"
						update=":activiteFormId:operationDataListId" />
				</div>
			</p:outputPanel>
		</h:form>
	</p:confirmDialog>

	<!-- End  Supprimer Operation  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- ________________________ -->


	<!-- Start  Supprimer Tache  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:confirmDialog id="deleteTacheDialog"
		message="Vous êtes sur de vouloir supprimer cette Tache #{activiteManagedBean.selectedTask.taskName} ? "
		header="Supprimer une Tache" severity="alert"
		widgetVar="deleteTacheDialogWv">
		<h:form>
			<p:outputPanel id="deldeleteTacheDialogPanel">
				<div align="right">
					<p:commandButton id="deleteTaskCanelId" value="Annuler"
						oncomplete="deleteTacheDialogWv.hide()" />
					<p:commandButton id="confirmDeleteTaskId" value="Supprimer"
						oncomplete="deleteTacheDialogWv.hide()"
						actionListener="#{activiteManagedBean.deleteTache}"
						update=":activiteFormId:tacheDataListId" />
				</div>
			</p:outputPanel>
		</h:form>
	</p:confirmDialog>

	<!-- End  Supprimer Tache  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- ________________________ -->



	<!-- Start  Supprimer Processus  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<p:confirmDialog id="deleteProcessusDialog"
		message="Vous êtes sur de vouloir supprimer ce processus ?"
		header="Supprimer un processus" severity="alert"
		widgetVar="deletepPocessusDialogWv">
		<h:form>
			<p:outputPanel id="deldeleteProcessusDialogPanel">

				<div align="right">
					<p:commandButton id="confirmDeleteProcessusCancelId"
						value="Annuler" onclick="deletepPocessusDialogWv.hide()" />
					<p:commandButton id="confirmDeleteProcessusId" value="Supprimer"
						oncomplete="deletepPocessusDialogWv.hide()"
						actionListener="#{activiteManagedBean.deleteProcessus}"
						update=":activiteFormId:processusDataListId" />
				</div>

			</p:outputPanel>
		</h:form>
	</p:confirmDialog>

	<!-- End  Supprimer Processus  -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->
	<!-- ________________________ -->

	<!-- ________________________ -->



	<h:form id="activiteFormId">

		<h1>Activités</h1>
		<br />


		<h2 class="tit">Création des Activités</h2>
		<br />
		<table class="nostyle">
			<tr>
				<td><p:commandButton id="commandButtonAddOperationId"
						value="Ajout Operation" onclick="addOperation2Wv.show();" /></td>
				<td><p:spacer width="200" height="10" /> <p:commandButton
						id="basic" value="Ajouter Processus"
						oncomplete="addProcessusWv.show();" /></td>
				<td><p:spacer width="200" height="10" /> <p:commandButton
						id="basic2" value="Ajouter Tache" onclick="addTacheWv.show();" /></td>

			</tr>
		</table>

		<center>
			<table class="nostyle" width="90%" align="center">
				<tr>
					<td><p:dataList value="#{listactiv.cars}" var="car"
							id="processusDataListId" paginator="true" rows="15"
							effectSpeed="fast"
							paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink}"
							paginatorPosition="bottom" type="none">

							<f:facet name="header">  
                Processus
            </f:facet>

							<p:column>

								<table class="nostyle">

									<tbody>
										<tr>
											<td style="width: 250px"><p:selectBooleanCheckbox /> <p:spacer
													height="5" width="10" /> <h:graphicImage
													url="./images/btnblanc.png" height="15" width="20" /> <p:spacer
													height="5" width="10" /> <h:graphicImage
													url="./images/cr2.png" height="13" width="13" /> <p:spacer
													height="5" width="10" /> <h:commandLink
													value="#{car.nomp}" style="margin-left:10px"
													onclick="s2carDialoggs.show();return false;">
													<f:setPropertyActionListener value="#{car}"
														target="#{listactiv.selectedCar}" />

												</h:commandLink></td>
											<td>
												<table class="nostyle">
													<tr>
														<td><p:commandButton icon="ui-icon-pencil"
																style="font-size:4px" /></td>
														<td><p:spacer height="5" width="5" /></td>
														<td><p:commandButton icon="ui-icon-circle-close"
																style="font-size:4px">
															</p:commandButton></td>
													</tr>
												</table>

											</td>

										</tr>
									</tbody>
								</table>


							</p:column>
						</p:dataList></td>
					<td><p:dataList value="#{activiteManagedBean.tasks}"
							var="tasksVar" id="tacheDataListId" paginator="true" rows="13"
							widgetVar="dataListTasksWv"
							paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink}"
							type="none" paginatorPosition="bottom">

							<f:facet name="header">  
              Tâche  
            </f:facet>

							<p:column>

								<table class="nostyle">

									<tbody>

										<tr>
											<td style="width: 900px"><p:selectBooleanCheckbox /> <p:spacer
													height="5" width="10" /> <p:graphicImage
													binding="#{activiteManagedBean.image}"
													url="./images/btnblanc.png" height="15" width="20" /> <p:spacer
													height="5" width="10" /> <h:graphicImage
													url="./images/cr2.png" height="13" width="13" /> <p:spacer
													height="5" width="10" /> <p:colorPicker id="color"
													style="width:5; height:5;"
													value="#{activiteManagedBean.taskColorDataList}"
													widgetVar="pickerWv" binding="#{activiteManagedBean.color}" />
												<p:spacer height="5" width="10" /> <p:commandLink
													style="margin-left:10px" oncomplete="editTacheWv.show()"
													value="#{tasksVar.taskName}" 	update=":editTacheId">
													<f:setPropertyActionListener value="#{tasksVar}"
														target="#{activiteManagedBean.selectedTask}" />

												</p:commandLink></td>
											<td>
												<table class="nostyle">
													<tr>
														<td><p:commandButton icon="ui-icon-pencil"
																update=":editTacheId" oncomplete="editTacheWv.show()"
																title="Editer une tache" style="font-size:4px">
																<f:setPropertyActionListener value="#{tasksVar}"
																	target="#{activiteManagedBean.selectedTask}" />
															</p:commandButton></td>
														<td><p:spacer height="5" width="5" /></td>
														<td><p:commandButton icon="ui-icon-circle-close"
																oncomplete="deleteTacheDialogWv.show()"
																update=":deleteTacheDialog" title="Supprimer une tache"
																style="font-size:4px">
																<f:setPropertyActionListener value="#{tasksVar}"
																	target="#{activiteManagedBean.selectedTask}" />
															</p:commandButton></td>
													</tr>
												</table>



											</td>
										</tr>
									</tbody>
								</table>
							</p:column>
						</p:dataList></td>
					<td><p:dataList id="operationDataListId"
							value="#{activiteManagedBean.operations}" var="operationsVar"
							paginator="true" rows="15" effectSpeed="fast"
							paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink} "
							paginatorPosition="bottom" type="none">

							<f:facet name="header">  
              Operation
            </f:facet>

							<p:column>

								<table class="nostyle">


									<tbody>
										<tr>
											<td style="width: 700px;"><p:selectBooleanCheckbox /> <p:spacer
													height="5" width="10" /> <h:graphicImage
													url="./images/btnblanc.png" height="15" width="20" /> <p:spacer
													height="5" width="10" /> <h:graphicImage
													url="#{activiteManagedBean.toBeAddedOrEditedOperation.magasinCanDeleteOperationCirclePath}" height="13" width="13" /> <p:spacer
													height="5" width="10" /> <p:commandLink
													value="#{operationsVar.name}" style="margin-left:10px"
													oncomplete="editOperationWv.show()">
													<f:setPropertyActionListener value="#{operationsVar}"
														target="#{activiteManagedBean.selectedOperation}" />

												</p:commandLink></td>
											<td>
												<table class="nostyle">
													<tr>
														<td><p:commandButton icon="ui-icon-pencil"
																update=":editOperationId" oncomplete="editOperationWv.show()"
																title="Editer une Operation" style="font-size:4px">
																<f:setPropertyActionListener value="#{operationsVar}"
																	target="#{activiteManagedBean.selectedOperation}" />
															</p:commandButton></td>
														<td><p:spacer height="5" width="5" /></td>
														<td><p:commandButton icon="ui-icon-circle-close"
																oncomplete="deleteOperationDialogWv.show()"
																update=":deleteOperationDialog" title="Supprimer une Operation"
																style="font-size:4px">
																<f:setPropertyActionListener value="#{operationsVar}"
																	target="#{activiteManagedBean.selectedOperation}" />
															</p:commandButton></td>
													</tr>
												</table>
											</td>
										</tr>
									</tbody>
								</table>

							</p:column>
						</p:dataList></td>
				</tr>
			</table>

		</center>
	</h:form>

</f:view>


		</html>

	</ui:define>
</ui:composition>